#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cmath>

using namespace std;

int arr[16][16];

int main()
{
	int n;
	while (cin >> n, n)
	{
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				arr[i][j] = pow(2, i + j);
			}
		}
		for (int i = 0; i < n; i++)
		{
			for (int j = 0; j < n; j++)
			{
				cout << arr[i][j] << ' ';
			}
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}